﻿// FeatureSubject.cs
using NetTopologySuite.Features;
using System.Collections.Generic;

namespace Observer
{
    public class FeatureSubject : ISubject
    {
        private List<IObserver> _observers = new List<IObserver>();
        public IFeature Feature { get; set; }
        public ChangeStatus Status { get; set; }

        public void Attach(IObserver observer)
        {
            _observers.Add(observer);
        }

        public void Detach(IObserver observer)
        {
            _observers.Remove(observer);
        }

        public void Notify()
        {
            foreach (var observer in _observers)
            {
                observer.Update(Feature, Status);
            }
        }
    }
}